home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 2 / CD ACTUAL VOL 2.iso / docs / kernel.13 / readme.scc < prev    next >
Encoding:
Text File  |  1995-09-10  |  28.7 KB  |  934 lines

  1. This is a subset of the documentation. To use this driver you MUST have the
  2. full package from:
  3.  
  4. Internet:
  5. =========
  6.  
  7. ftp.ucsd.edu:/hamradio/packet/tcpip/incoming/z8530drv-1.8.dl1bke.tar.gz
  8.  
  9. and various mirrors (i.e. nic.switch.ch)
  10.  
  11. AX.25 BBS
  12. =========
  13.  
  14. UNIX @ DB0ACH.#NRW.DEU.EU, subject: Z8530D18.Pxx/Pyy
  15.  
  16. (AX.25 call: DB0ACH-8)
  17.  
  18. and various BBS that received the file through AUTO7P or 7PSERV
  19. with the filename Z8530D18.TGZ
  20.  
  21.  
  22. ---------------------------------------------------------------------------
  23.  
  24. !! Version 1.8
  25. !!
  26. !! Deutscher Text siehe scc_ger.doc
  27. !! 
  28. !! perhaps somebody could correct the English documentation (grammar,
  29. !! spelling)?
  30. !!
  31. !! BTW: REAL programmers don't document...
  32. !!
  33.  
  34.  
  35.      SCC.C - Linux driver for Z8530 based HDLC cards for AX.25      
  36.  
  37.    ********************************************************************
  38.  
  39.         (c) 1994 by Joerg Reuter DL1BKE
  40.  
  41.         portions (c) 1994 Hans Alblas PE1AYX
  42.         and      (c) 1993 Guido ten Dolle PE1NNZ
  43.  
  44.         for the complete copyright notice see >> Copying.Z8530DRV <<
  45.  
  46.    ******************************************************************** 
  47.  
  48.  
  49. 0. Installation of the package
  50. ==============================
  51.  
  52. Run SCC-Install. If one (or more) of the patches fails PLEASE consult 
  53. chapter 2 (and READ IT of course!)
  54.  
  55.  
  56.  
  57. 1. Initialization and attachment of the channels
  58. ================================================
  59.  
  60. To use the driver, 3 steps must be performed:
  61.  
  62.      1. Global initialization of the driver in the kernel
  63.      2. Setup of parameters with sccinit
  64.      2. Attachment of each channel in the packet software
  65.  
  66. The global initialization is needed to reset all SCCs and to 
  67. install a common interrupt handler.  Also, the hardware addresses 
  68. of the chips are defined in this step.  In the second step, each 
  69. channel is set up for the intended use.
  70.  
  71.  
  72.  
  73. 1.1. Initialization
  74. ===================
  75.  
  76. Initialization of the hardware is performed by setting the defines and
  77. variables in the file "/linux/drivers/char/scc_config.h". You can change 
  78. a number of parameters.
  79.  
  80.  
  81.  
  82. ################################################################################################
  83. # For OptoSCC card e.g:
  84. #
  85.  
  86. int     Nchips       = 2        ; /* number of chips */
  87. io_port Vector_Latch = 0x168    ; /* addr. of INTACK-Latch (0 for poll mode)
  88. */
  89. int     Ivec         = 9        ; /* interrupt vector */
  90. long    Clock        = 4915200  ; /* frequency of the scc clock */
  91. char    Pclk         = 1        ; /* use PCLK (1) or RTxC (0) */
  92. char    Board        = PA0HZP   ; /* what type of SCC card do you use? */
  93. int     Option       = 0        ; /* command for extra hardware */
  94. io_port Special_Port = 0        ; /* port address for special hardware */
  95.                                   /* (for EAGLE, PC100, PRIMUS, DRSI) */
  96.  
  97.                         /*      ^  never remove the semicolon !! */
  98.  
  99.  
  100. /*                      Channel    A      B         Chip        */
  101. /*                               ============     ========      */
  102. /* Control ports:                                               */
  103.  
  104. io_port SCC_ctrl[MAXSCC * 2] =  {0x152, 0x150,  /* ...one...    */
  105.                                  0x156, 0x154,  /* ...two...    */
  106.                                      0,     0,  /* ...three...  */
  107.                                      0,     0}; /* ...four...   */
  108.             
  109.  
  110. /* Data ports:                            */
  111.  
  112. io_port SCC_data[MAXSCC * 2] =  {0x153, 0x151,    /* ...one...    */
  113.                  0x157, 0x155,    /* ...two...    */
  114.                      0,     0,    /* ...three...    */
  115.                      0,     0};    /* ...four...    */
  116.  
  117.  
  118. /* set to '1' if you have and want ESCC chip (8580/85180/85280) support */
  119.  
  120. /*                          Chip    */
  121. /*                            ========       */
  122. int SCC_Enhanced[MAXSCC] =    {0,    /* ...one...    */
  123.                  0,      /* ...two...    */
  124.                  0,      /* ...three...    */
  125.                  0};    /* ...four...    */
  126.  
  127. /* some useful #defines. You might need them or not */
  128.  
  129. #define VERBOSE_BOOTMSG 1
  130. #undef  SCC_DELAY        /* perhaps a 486DX2 is a *bit* too fast */
  131. #undef  SCC_LDELAY        /* slow it even a bit more down */
  132. #undef  DONT_CHECK        /* don't look if the SCCs you specified are available */
  133.  
  134.  
  135. /*********** END OF CONFIGURATION PARAMETERS ********************************************/
  136.  
  137.  
  138.  
  139.  
  140. ################################################################################################
  141. # For Baycom (U)SCC card e.g:
  142. #
  143.  
  144. int     Nchips         = 2    ; /* number of chips */
  145. io_port Vector_Latch = 0    ; /* addr. of INTACK-Latch (0 for poll mode) */
  146. int     Ivec         = 7    ; /* interrupt vector */
  147. long    Clock         = 4915200    ; /* frequency of the scc clock */
  148. char    Board         = BAYCOM    ; /* what type of SCC card do you use? */
  149. int    Option         = 0    ; /* command for extra hardware */
  150. io_port Special_Port = 0    ; /* port address for special hardware */
  151.                   /* (for EAGLE, PC100, PRIMUS, DRSI) */
  152.  
  153.             /*      ^  never remove the semicolon !! */
  154.             
  155.  
  156.  
  157. /*             Channel    A      B        Chip    */
  158. /*                     ============      ========    */
  159. /* Control ports:                        */
  160.  
  161. io_port SCC_ctrl[MAXSCC * 2] =     {0x304, 0x305,  /* ...one...     */
  162.                  0x306, 0x307,  /* ...two...    */
  163.                      0,     0,  /* ...three...    */
  164.                      0,     0}; /* ...four...    */
  165.  
  166. /* Data ports:                            */
  167.  
  168. io_port SCC_data[MAXSCC * 2] =  {0x300, 0x301,    /* ...one...    */
  169.                  0x302, 0x303,    /* ...two...    */
  170.                      0,     0,    /* ...three...    */
  171.                      0,     0};    /* ...four...    */
  172.  
  173.  
  174. /* set to '1' if you have and want ESCC chip (8580/85180/85280) support */
  175.  
  176. /*                          Chip    */
  177. /*                            ========       */
  178. int SCC_Enhanced[MAXSCC] =    {0,    /* ...one...    */
  179.                  0,      /* ...two...    */
  180.                  0,      /* ...three...    */
  181.                  0};    /* ...four...    */
  182.  
  183. /* some useful #defines. You might need them or not */
  184.  
  185. #define VERBOSE_BOOTMSG 1
  186. #undef  SCC_DELAY        /* perhaps a 486DX2 is a *bit* too fast */
  187. #undef  SCC_LDELAY        /* slow it even a bit more down */
  188. #undef  DONT_CHECK        /* don't look if the SCCs you specified are available */
  189.  
  190. After you changed a parameter you have to recompile a new kernel image file.
  191.  
  192. The channel number ranges from 0 to (2 * Nchips) - 1,
  193. where Nchips is the number of chips.
  194.  
  195. The crystal clock is specified as 4.9152 MHz.  Other frequencies 
  196. can be used, and this parameter should be adjusted accordingly.
  197.  
  198.  
  199. You can define your scc type with Board
  200.  
  201.    SCC type                 value
  202.    ---------------------------------
  203.    PA0HZP SCC card          PA0HZP
  204.    EAGLE card               EAGLE
  205.    PC100 card               PC100
  206.    PRIMUS-PC (DG9BL) card   PRIMUS
  207.    BayCom (U)SCC card       BAYCOM
  208.  
  209.  
  210. NOTE:
  211. =====
  212.  
  213. If you only know the parameters for the PE1CHL driver for DOS,
  214. run gencfg. It will generate the correct port addresses (I hope).
  215. Its parameters are exactly the same as the ones you use with
  216. the "attach scc" command in net, except that the string "init" must 
  217. not appear. Example:
  218.  
  219. gencfg 2 0x150 4 2 0 1 0x168 9 4915200 
  220.  
  221. will print a short form of scc_config.h for the OptoSCC to stdout. 
  222. ("short" <=> few comments).
  223.  
  224. gencfg 2 0x300 2 4 5 -4 0 7 4915200 0x10
  225.  
  226. does the same for the BayCom USCC card. I my opinion it is much easier
  227. to edit scc_config.h... 
  228.  
  229.  
  230. 1.2 initializing the driver on bootup
  231. =====================================
  232.  
  233.  
  234. To setup a number parameters you must run /sbin/sccinit from one
  235. of your rc.*-files. This has to be done BEFORE the start of
  236. NET or the ax25attach. Sccinit reads the file /etc/z8530drv.rc
  237. and sets the MODEM and KISS parameters. A sample file is
  238. delivered with this package. Change it to your needs:
  239.  
  240. Each channel definition is divided into three sections. An
  241. example for /dev/sc1:
  242.  
  243. # DEVICE
  244.  
  245. device /dev/sc1        # the device for the following params
  246.  
  247. # MODEM
  248.  
  249. speed 1200        # the default baudrate
  250. clock dpll        # clock source: 
  251.             #     dpll     = normal halfduplex operation
  252.             #     external = MODEM provides own Rx/Tx clock
  253.             #    divider  = use fullduplex divider if
  254.             #           installed (1)
  255. mode nrzi        # HDLC encoding mode
  256.             #    nrzi = 1k2 MODEM, G3RUH 9k6 MODEM
  257.             #    nrz  = DF9IC 9k6 MODEM
  258. # KISS (Layer 1)
  259.  
  260. txdelay 36              # (see chapter 1.4)
  261. persist 64
  262. slot    8
  263. tail    8
  264. fulldup 0
  265. wait    12
  266. min     3
  267. maxkey  7
  268. idle    3
  269. maxdef  120
  270. group   0
  271. txoff   off
  272. softdcd on                   
  273. slip    off
  274.  
  275. The order WITHIN these sections is unimportant. The order OF these
  276. sections IS important. The MODEM parameters are set with the first
  277. recognized KISS paramer...
  278.  
  279. Please note that you can initialize the board only once after boot. 
  280. You can change all paramters but "mode" and "clock" later with the
  281. Sccparam program or through KISS. Just to avoid securety holes... 
  282.  
  283. (1) this divider is usually mounted on the SCC-PBC (PA0HZP) or not
  284.     present at all (BayCom). It feeds back the output of the DPLL 
  285.     (digital pll) as transmit clock. Using this mode without a divider 
  286.     installed will normally result in keying the transceiver until 
  287.     maxkey expires --- of course without sending anything (useful).
  288.  
  289.  
  290. 1.3. Attach commands
  291. ====================
  292.  
  293. When the linux has startup, the SCC driver has been initialized,
  294. you can attach the channels in your packet software. This is done
  295. by open the scc devices by using the attach asy command.
  296. The SCC-drivers emulates the scc devices as serial asy ports,
  297. this means e.g. that the baudrate can be set in the attach command.
  298.  
  299.  
  300. Example Wampes:
  301.  
  302. #############################################################################################
  303. # Wampes device attach
  304. # NOTE: Interfacename and the device must be the same!!
  305. # Usage: attach asy 0 0 slip|vjslip|ax25ui|ax25i|nrs|kissui <label> 0 <mtu> <speed> [ip_addr]
  306. #
  307. attach asy 0 0 kissi sc1 256 256 1200    # Attach SCC channel 1 in 1200 baud
  308. attach asy 0 0 kissi sc2 256 256 1200    # Attach SCC channel 2 in 1200 baud
  309. attach asy 0 0 kissui sc3 256 256 38400  # Attach SCC channel 3 in 38400 baud
  310. attach asy 0 0 kissui sc4 256 256 9600   # Attach SCC channel 4 in 9600 baud
  311. #                ^
  312. #                 for WAMPES 921229 use here: ax25
  313. #
  314.  
  315. Example JNOS:
  316.  
  317. ############################################
  318. # JNOS device attach
  319. #
  320. #attach asy sc1 0 ax25 sc1 256 256 1200
  321. #attach asy sc2 0 ax25 sc2 256 256 1200
  322. #attach asy sc3 0 ax25 sc3 256 256 300
  323. #attach asy sc4 0 ax25 sc4 256 256 4800
  324. #
  325. #
  326.  
  327.  
  328. It allows AX.25 communication without a TNC.  Only a MODEM is
  329. needed. The parameters have the same meaning as in KISS mode.
  330. In fact, the AX.25 mode is emulating an extended KISS TNC, so
  331. the same commands can be used to set the parameters of the
  332. interface (see below).
  333.  
  334. To be able to run fullduplex using an SCC in AX.25 mode, an 
  335. external divider must be available, that divides the baudrate 
  336. generator clock available on the TRxC pin by 32, and puts the 
  337. resulting signal on the RTxC pint of the same channel of the SCC.  
  338. Such a divider is not necessary for normal CSMA packet radio 
  339. operation, but interrupt overhead is slightly reduced if you 
  340. still install it.  
  341.  
  342.  
  343.  
  344. 1.4. Displaying SCC Parameters:
  345. ===============================
  346.  
  347. Once a SCC channel has been attached, the parameter settings and 
  348. some statistic information can be shown using the param program:
  349.  
  350. dl1bke-u:~$ sccstat /dev/sc1
  351.  
  352. Parameters:
  353.  
  354. speed       : 1200 baud
  355. txdelay     : 36
  356. persist     : 255
  357. slottime    : 0
  358. txtail      : 8
  359. fulldup     : 1
  360. waittime    : 12
  361. mintime     : 3 sec
  362. maxkeyup    : 7 sec
  363. idletime    : 3 sec
  364. maxdefer    : 120 sec
  365. group       : 0x00
  366. txoff       : off
  367. softdcd     : on
  368. SLIP        : off
  369.  
  370. Status:
  371.  
  372. HDLC                  Z8530           Interrupts         Queues
  373. -----------------------------------------------------------------------
  374. Sent       :     273  RxOver :     0  RxInts :   125074  RxQueue :    0
  375. Received   :    1095  TxUnder:     0  TxInts :     4684  TxQueue :    0
  376. RxErrors   :    1591                  ExInts :    11776
  377. KissErrors :       0                  SpInts :     1503  NoSpace :    0
  378. Tx State   :    idle
  379.  
  380. Memory allocated:
  381.  
  382. Total  :    1
  383. RxAlloc:    0
  384. TxAlloc:    1
  385.  
  386.  
  387. The status info shown is:
  388.  
  389. Sent        - number of frames transmitted
  390. Received    - number of frames received
  391. RxErrors    - number of receive errors (CRC, ABORT)
  392. KissErrors    - number of KISS errors (should be zero...)
  393. Tx State    - status of the Tx interrupt handler: idle/busy/active/tail (2)
  394. RxOver        - number of receiver overruns
  395. TxUnder        - number of transmitter underruns     
  396. RxInts        - number of receiver interrupts
  397. TxInts        - number of transmitter interrupts
  398. EpInts        - number of receiver special condition interrupts
  399. SpInts        - number of external/status interrupts
  400. RxQueue        - number of received packets enqueued for this channel
  401. TxQueue        - number of packets enqueued for Tx
  402. NoSpace        - number of times the receiver buffer pool was found empty
  403.  
  404.  
  405. An overrun is abnormal. If lots of these occur, the product of
  406. baudrate and number of interfaces is too high for the processing
  407. power of you computer. If "Space" errors occur, specify a higher
  408. number of buffers in the "scc.h" file.
  409.  
  410.  
  411. 1.5 Setting Parameters
  412. ======================
  413.  
  414.  
  415. The setting of parameters of the emulated KISS TNC is done in the 
  416. same way in the SCC driver. You can change parameters by using
  417. the command param in NET or NOS
  418.  
  419.      param <iface> <paramname> <value>
  420.  
  421. or use the program "sccparam":
  422.  
  423.      sccparam <device> <paramname> <decimal-|hexadecimal value>
  424.  
  425. You can change the following parameters:
  426.  
  427. param        : value
  428. ------------------------
  429. speed       : 1200
  430. txdelay     : 36
  431. persist     : 255
  432. slottime    : 0
  433. txtail      : 8
  434. fulldup     : 1
  435. waittime    : 12
  436. mintime     : 3
  437. maxkeyup    : 7
  438. idletime    : 3
  439. maxdefer    : 120
  440. group       : 0x00
  441. txoff       : off
  442. softdcd     : on
  443. SLIP        : off
  444.  
  445.  
  446. The parameters have the following meaning:
  447.  
  448. speed:
  449.      The baudrate on this channel in bits/sec
  450.  
  451.      Example: sccparam /dev/sc4 speed 9600
  452.  
  453. txdelay:
  454.      The delay (in units of 10ms) after keying of the 
  455.      transmitter, until the first byte is sent. This is usually 
  456.      called "TXDELAY" in a TNC.  When 0 is specified, the driver 
  457.      will just wait until the CTS signal is asserted. This 
  458.      assumes the presence of a timer or other circuitry in the 
  459.      MODEM and/or transmitter, that asserts CTS when the 
  460.      transmitter is ready for data.
  461.      A normal value of this parameter is 30-36.
  462.  
  463.      Example: sccparam /dev/sc1 txd 20
  464.  
  465. persist:
  466.      This is the probability that the transmitter will be keyed 
  467.      when the channel is found to be free.  It is a value from 0 
  468.      to 255, and the probability is (value+1)/256.  The value 
  469.      should be somewhere near 50-60, and should be lowered when 
  470.      the channel is used more heavily.
  471.  
  472.      Example: sccparam /dev/sc3 persist 20
  473.  
  474. slottime:
  475.      This is the time between samples of the channel. It is 
  476.      expressed in units of 10ms.  About 200-300 ms (value 20-30) 
  477.      seems to be a good value.
  478.  
  479.      Example: sccparam /dev/sc1 slot 20
  480.  
  481. tail:
  482.      The time the transmitter will remain keyed after the last 
  483.      byte of a packet has been transferred to the SCC. This is 
  484.      necessary because the CRC and a flag still have to leave the 
  485.      SCC before the transmitter is keyed down. The value depends 
  486.      on the baudrate selected.  A few character times should be 
  487.      sufficient, e.g. 40ms at 1200 baud. (value 4)
  488.      The value of this parameter is in 10ms units.
  489.  
  490.      Example: sccparam /dev/sc3 4
  491.  
  492. full:
  493.      The full-duplex mode switch. This can be one of the folowing 
  494.      values:
  495.  
  496.      0:   The interface will operate in CSMA mode (the normal 
  497.           half-duplex packet radio operation)
  498.      1:   Fullduplex mode, i.e. the transmitter will be keyed at 
  499.           any time, without checking the received carrier.  It 
  500.           will be unkeyed when there are no packets to be sent.
  501.      2:   Like 1, but the transmitter will remain keyed, also 
  502.           when there are no packets to be sent.  Flags will be 
  503.           sent in that case, until a timeout (parameter 10) 
  504.           occurs.
  505.  
  506.      Example: sccparam /dev/sc1 fulldup off
  507.  
  508. wait:
  509.      The initial waittime before any transmit attempt, after the 
  510.      frame has been queue for transmit.  This is the length of 
  511.      the first slot in CSMA mode.  In fullduplex modes it is
  512.      set to 0 for maximum performance.
  513.      The value of this parameter is in 10ms units. 
  514.  
  515.      Example: sccparam /dev/sc2 wait 4
  516.  
  517. maxkey:
  518.      The maximal time the transmitter will be keyed to send 
  519.      packets, in seconds.  This can be useful on busy CSMA 
  520.      channels, to avoid "getting a bad reputation" when you are 
  521.      generating a lot of traffic.  After the specified time has 
  522.      elapsed, no new frame will be started. Instead, the trans-
  523.      mitter will be switched off for a specified time (parameter 
  524.      min), and then the selected algorithm for keyup will be 
  525.      started again.
  526.      The value 0 as well as "off" will disable this feature, 
  527.      and allow infinite transmission time. 
  528.  
  529.      Example: sccparam /dev/sc1 maxk 20
  530.  
  531. min:
  532.      This is the time the transmitter will be switched off when 
  533.      the maximum transmission time is exceeded.
  534.  
  535.      Example: sccparam /dev/sc4 min 10
  536.  
  537. idle
  538.      This parameter specifies the maximum idle time in fullduplex 
  539.      2 mode, in seconds.  When no frames have been sent for this 
  540.      time, the transmitter will be keyed down.  A value of 0 is
  541.      has same result as the fullduplex mode 1. This parameter
  542.      can be disabled.
  543.  
  544.      Example: sccparam /dev/sc3 idle off    # transmit forever
  545.  
  546. maxdefer
  547.      This is the maximum time (in seconds) to wait for a free channel
  548.      to send. When this timer expires the transmitter will be keyed 
  549.      IMMEDIATLY. If you love to get trouble with other users you
  550.      should set this to a very low value ;-)
  551.  
  552.      Example: sccparam /dev/sc1 maxdefer 240    # 2 minutes
  553.  
  554.  
  555. txoff:
  556.      When this parameter has the value 0, the transmission of packets
  557.      is enable. Otherwise it is disabled.
  558.  
  559.      Example: sccparam /dev/sc3 txoff on
  560.  
  561. group:
  562.      It is possible to build special radio equipment to use more than 
  563.      one frequency on the same bad, e.g. using several receivers and 
  564.      only one transmitter that can be switched between frequencies.
  565.      Also, you can connect several radios that are active on the same 
  566.      band.  In these cases, it is not possible, or not a good idea, to 
  567.      transmit on more than one frequency.  The SCC driver provides a 
  568.      method to lock transmitters on different interfaces, using the 
  569.      "param <interface> group <x>" command.  This will only work when 
  570.      you are using CSMA mode (parameter full = 0).
  571.      The number <x> must be 0 if you want no group restrictions, and 
  572.      can be computed as follows to create restricted groups:
  573.      <x> is the sum of some OCTAL numbers:
  574.  
  575.      200  This transmitter will only be keyed when all other 
  576.           transmitters in the group are off.
  577.      100  This transmitter will only be keyed when the carrier 
  578.           detect of all other interfaces in the group is off.
  579.      0xx  A byte that can be used to define different groups.  
  580.           Interfaces are in the same group, when the logical AND 
  581.           between their xx values is nonzero.
  582.  
  583.      Examples:
  584.      When 2 interfaces use group 201, their transmitters will never be 
  585.      keyed at the same time.
  586.      When 2 interfaces use group 101, the transmitters will only key 
  587.      when both channels are clear at the same time.  When group 301, 
  588.      the transmitters will not be keyed at the same time.
  589.  
  590.      Don't forget to convert the octal numbers into decimal before
  591.      you set the parameter.
  592.  
  593.      Example: (to be written)
  594.  
  595. softdcd:
  596.      use a software dcd instead of the real one... Useful for a very
  597.      slow squelch.
  598.  
  599.      Example: sccparam /dev/sc1 soft on
  600.  
  601.  
  602. slip:
  603.      use slip encoding instead of kiss
  604.  
  605.      Example: sccparam /dev/sc2 slip on
  606.  
  607.  
  608.  
  609. 2. Problems
  610. ===========
  611.  
  612. We are poking around in somebody else's code, so everything may change
  613. from one patchlevel to another... If the patches fail, try the
  614. following:
  615.  
  616. 2.1 /linux/drivers/char/Makefile
  617. ================================
  618.  
  619. Add "scc.o" to the definition of OBJS and "scc.c" to SRCS
  620.  
  621.  
  622. 2.2 /linux/include/linux/tty_driver.h
  623. =====================================
  624.  
  625. add the following DEFINE:
  626.  
  627. #define TTY_DRIVER_TYPE_SCC 0x0005
  628.  
  629.  
  630. 2.3 /linux/drivers/char/tty_io.c
  631. ================================
  632.  
  633. in tty_init() add the line
  634.  
  635.     kmem_start=scc_init(kmem_start);
  636.  
  637. just before "return kmem_start".
  638.  
  639. 2.4 /linux/arch/i386/config.in
  640. ==============================
  641.  
  642. somewhere in that file add:
  643.  
  644.     comment 'Z8530 SCC driver for Amateur Packet Radio'
  645.     bool 'KISS emulator for Z8530 based HDLC cards' CONFIG_SCC y
  646.     comment ''
  647.   
  648.  
  649.  
  650. 2.5 Other problems
  651. ==================
  652.  
  653. If you have tx-problems with your BayCom USCC card please check
  654. the manufacturer of the 8530. SGS chips have a slightly
  655. different timing. Try Zilog... I have no information if this
  656. driver works with baudrates higher than 1200 baud. A solution is
  657. to write to register 8 instead to the data port, but this won't
  658. work with the ESCC chips *SIGH!*
  659.  
  660. I got reports that the driver has problems on some 386-based systems.
  661. (i.e. Amstrad) Those systems have a bogus AT bus timing which will
  662. lead to delayed answers on interrupts. You can recognize these
  663. problems by looking at the output of Sccstat for the suspected
  664. port. See if it shows under- and overruns you own such a system.
  665. Perhaps it will help if you simplify the scc_isr() function a bit.
  666. You'll find a slightly faster version in the files scc_isr_intack
  667. or scc_isr_novec.
  668.  
  669.  
  670. Delayed processing of received data: This depends on
  671.  
  672. - the kernel version
  673.  
  674. - kernel profiling compiled or not
  675.  
  676. - the rather slow receiver in tty_io.c
  677.  
  678. - a high interrupt load
  679.  
  680. - a high load of the maching --- running X, Xmorph, XV and Povray,
  681.   while compiling the kernel... hmm ... even with 32 MB RAM ...  ;-)
  682.  
  683. - NET's speed itself.
  684.  
  685.  
  686. Kernel panics (based on excerpts from /linux/README)
  687.  
  688.  
  689. - if a bug results in a message like
  690.  
  691.     unable to handle kernel paging request at address C0000010
  692.     Oops: 0002
  693.     EIP:   0010:XXXXXXXX
  694.     eax: xxxxxxxx   ebx: xxxxxxxx   ecx: xxxxxxxx   edx: xxxxxxxx
  695.     esi: xxxxxxxx   edi: xxxxxxxx   ebp: xxxxxxxx
  696.     ds: xxxx  es: xxxx  fs: xxxx  gs: xxxx
  697.     Pid: xx, process nr: xx
  698.     xx xx xx xx xx xx xx xx xx xx
  699.  
  700.   or similar kernel debugging information on your screen or in your
  701.   system log, please duplicate it *exactly*.  The dump may look
  702.   incomprehensible to you, but it does contain information that may
  703.   help debugging the problem.  The text above the dump is also
  704.   important: it tells something about why the kernel dumped code (in
  705.   the above example it's due to a bad kernel pointer)
  706.  
  707. - in debugging dumps like the above, please look up what the EIP value 
  708.   means.  The hex value as such doesn't help me or anybody else very much: 
  709.   it will depend on your particular kernel setup.  What you should do is 
  710.   take the hex value from the EIP line (ignore the "0010:"), and look it up 
  711.   in the kernel namelist to see which kernel function contains the offending 
  712.   address.
  713.  
  714.   To find out the kernel function name, you'll need to 
  715.  
  716.          less /linux/System.map
  717.  
  718.   This will give you a list of kernel addresses sorted in ascending
  719.   order, from which it is simple to find the function that contains the
  720.   offending address.  Note that the address given by the kernel
  721.   debugging messages will not necessarily match exactly with the
  722.   function addresses (in fact, that is very unlikely), so you can't
  723.   just 'grep' the list: the list will, however, give you the starting
  724.   point of each kernel function, so by looking for the function that
  725.   has a starting address lower than the one you are searching for but
  726.   is followed by a function with a higher address you will find the one
  727.   you want.  In fact, it may be [IS!] a good idea to include a bit of
  728.   "context" in your problem report, giving a few lines around the
  729.   interesting one. 
  730.  
  731.   I included a small program which does this for you. Just call
  732.  
  733.          grep_eip /linux/System.map address
  734.  
  735.   for example: grep_eip /linux/System.map 182f98
  736.  
  737. - alternately, you can use gdb on a running kernel. (read-only; i.e. you
  738.   cannot change values or set break points.) To do this, first compile the
  739.   kernel with -g; edit arch/i386/Makefile appropriately, then do a "make
  740.   clean". You'll also need to enable CONFIG_PROC_FS (via "make config").
  741.  
  742.   After you've rebooted with the new kernel, do "gdb vmlinux /proc/kcore".
  743.   You can now use all the usual gdb commands. The command to look up the
  744.   point where your system crashed is "l *0xXXXXXXXX". (Replace the XXXes
  745.   with the EIP value.)
  746.  
  747.   gdb'ing a non-running kernel currently fails because gdb (wrongly)
  748.   disregards the starting offset for which the kernel is compiled.
  749.  
  750.  
  751.  
  752. If you can't solve a problem, send me
  753.  
  754. - a description of the problem,
  755. - information on your hardware (computer system, scc board, modem)
  756. - your kernel version
  757. - the output of sccstat /dev/sc# ("#" is the No. of the channel)
  758. - the settings of "speed", "clock" and "mode" for that channel
  759.   in /etc/z8530drv.rc
  760. - your scc_config.h
  761.  
  762.  
  763. And always remember: 
  764. The 1.1.* kernel series is for alpha tests -- use at your own risk ;-)
  765. The 1.2.* series should run reliable. This driver perhaps NOT!
  766.  
  767. ------------
  768.  
  769. Example scc_config.h
  770.  
  771. #include <linux/scc.h>
  772.  
  773. /********* CONFIGURATION PARAMATERES; PLEASE CHANGE THIS TO YOUR OWN SITUATION **********/
  774.  
  775. /* SCC hardware parameters */
  776.  
  777. /* use the following board types: 
  778.  *
  779.  *    PA0HZP        OptoSCC (PA0HZP)
  780.  *    EAGLE             EAGLE
  781.  *    PC100             PC100 
  782.  *    PRIMUS            PRIMUS-PC (DG9BL)
  783.  *    DRSI              DRSI PC*Packet
  784.  *    BAYCOM            BayCom (U)SCC
  785.  *    
  786.  */
  787.  
  788. int     Nchips         = 2    ; /* number of chips */
  789. io_port Vector_Latch = 0    ; /* addr. of INTACK-Latch (0 for poll mode) */
  790. int     Ivec         = 7    ; /* interrupt vector */
  791. long    Clock         = 4915200    ; /* frequency of the scc clock */
  792. char    Board         = BAYCOM    ; /* what type of SCC card do you use? */
  793. int    Option         = 0    ; /* command for extra hardware */
  794. io_port Special_Port = 0    ; /* port address for special hardware */
  795.                   /* (for EAGLE, PC100, PRIMUS, DRSI) */
  796.  
  797.             /*      ^  never remove the semicolon !! */
  798.             
  799.  
  800.  
  801. /*             Channel    A      B        Chip    */
  802. /*                     ============      ========    */
  803. /* Control ports:                        */
  804.  
  805. io_port SCC_ctrl[MAXSCC * 2] =     {0x304, 0x305,  /* ...one...     */
  806.                  0x306, 0x307,  /* ...two...    */
  807.                      0,     0,  /* ...three...    */
  808.                      0,     0}; /* ...four...    */
  809.  
  810. /* Data ports:                            */
  811.  
  812. io_port SCC_data[MAXSCC * 2] =  {0x300, 0x301,    /* ...one...    */
  813.                  0x302, 0x303,    /* ...two...    */
  814.                      0,     0,    /* ...three...    */
  815.                      0,     0};    /* ...four...    */
  816.  
  817.  
  818. /* set to '1' if you have and want ESCC chip (8580/85180/85280) support */
  819.  
  820. /*                          Chip    */
  821. /*                            ========       */
  822. int SCC_Enhanced[MAXSCC] =    {0,    /* ...one...    */
  823.                  0,      /* ...two...    */
  824.                  0,      /* ...three...    */
  825.                  0};    /* ...four...    */
  826.  
  827. /* some useful #defines. You might need them or not */
  828.  
  829. #define VERBOSE_BOOTMSG 1
  830. #undef  SCC_DELAY        /* perhaps a 486DX2 is a *bit* too fast */
  831. #undef  SCC_LDELAY        /* slow it even a bit more down */
  832. #undef  DONT_CHECK        /* don't look if the SCCs you specified are available */
  833.  
  834.  
  835. /* The external clocking, nrz and fullduplex divider configuration is gone */
  836. /* you can set these parameters in /etc/z8530drv.rc and initialize the  */
  837. /* driver with sccinit */
  838.  
  839. ---------
  840.  
  841. I still can't test the DRSI board, but this configuration derived from
  842. the PE1CHL SCC driver configuration should work:
  843.  
  844. An example of scc_config.h for 
  845.  
  846. One DRSI board installed:
  847. =========================
  848.  
  849. /* gencfg 1 0x300 0x10 2 0 1 0 7 4915200 */
  850.  
  851. /* file generated by $Id: gencfg.c,v 1.2 1994/11/29 21:42:24 JReuter Exp JReuter $ */
  852.  
  853. #include <linux/scc.h>
  854.  
  855. int     Nchips         = 1;
  856. io_port Vector_Latch = 0x0;
  857. int     Ivec         = 7;
  858. long    Clock         = 4915200;
  859. char    Board         = PA0HZP;
  860. int    Option         = 0;
  861. io_port Special_Port = 0x0;
  862.  
  863. io_port SCC_ctrl[MAXSCC * 2] =
  864. {0x302, 0x300, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
  865.  
  866. io_port SCC_data[MAXSCC * 2] =
  867. {0x303, 0x301, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
  868.  
  869. /* set to '1' if you have and want ESCC chip (8580/85180/85280) support */
  870.  
  871. /*                          Chip    */
  872. /*                            ========       */
  873. int SCC_Enhanced[MAXSCC] =    {0,    /* ...one...    */
  874.                  0,      /* ...two...    */
  875.                  0,      /* ...three...    */
  876.                  0};    /* ...four...    */
  877.  
  878. #define VERBOSE_BOOTMSG 1
  879. #undef  SCC_DELAY        /* perhaps a 486DX2 is a *bit* too fast */
  880. #undef  SCC_LDELAY        /* slow it even a bit more down */
  881. #undef  DONT_CHECK        /* don't look if the SCCs you specified are available */
  882.  
  883.  
  884.  
  885. Two boards installed:
  886. =====================
  887.  
  888. /* file generated by $Id: gencfg.c,v 1.2 1994/11/29 21:42:24 JReuter Exp JReuter $ */
  889.  
  890. #include <linux/scc.h>
  891.  
  892. int     Nchips         = 2;
  893. io_port Vector_Latch = 0x0;
  894. int     Ivec         = 7;
  895. long    Clock         = 4915200;
  896. char    Board         = PA0HZP;
  897. int    Option         = 0;
  898. io_port Special_Port = 0x0;
  899.  
  900. io_port SCC_ctrl[MAXSCC * 2] =
  901. {0x302, 0x300, 0x312, 0x310, 0x0, 0x0, 0x0, 0x0};
  902.  
  903. io_port SCC_data[MAXSCC * 2] =
  904. {0x303, 0x301, 0x313, 0x311, 0x0, 0x0, 0x0, 0x0};
  905.  
  906. /* set to '1' if you have and want ESCC chip (8580/85180/85280) support */
  907.  
  908. /*                          Chip    */
  909. /*                            ========       */
  910. int SCC_Enhanced[MAXSCC] =    {0,    /* ...one...    */
  911.                  0,      /* ...two...    */
  912.                  0,      /* ...three...    */
  913.                  0};    /* ...four...    */
  914.  
  915. #define VERBOSE_BOOTMSG 1
  916. #undef  SCC_DELAY        /* perhaps a 486DX2 is a *bit* too fast */
  917. #undef  SCC_LDELAY        /* slow it even a bit more down */
  918. #undef  DONT_CHECK        /* don't look if the SCCs you specified are available */
  919.  
  920.  
  921.  
  922.  
  923.  
  924. *****************
  925.  
  926. You  m u s t  use "clock dpll" in /etc/z8530drv.rc for operation, 
  927. the on-board baudrate generator is not supported.
  928.  
  929. *****************
  930.  
  931.  
  932. (mni tnx to Mike Bilow)
  933.  
  934.